from django.core import validators
from django.db import models


# Create your models here.

class Car(models.Model):
    car_id = models.CharField(max_length=8, primary_key=True)
    car_type = models.CharField(max_length=2, choices=((u'c1', u'manual shift gear'), (u'c2', u'automatic gearshift')))
    appointment_time = models.DateTimeField(null=True)
    appointment_persons = models.SmallIntegerField(default=0, validators=[
                    validators.MaxValueValidator(4), validators.MinValueValidator(0)])
#
# try:
#     for i in range(10):
#         Car.objects.create(
#             car_id='ABCD'+str(i),
#             car_type='c1'
#         )
#     for i in range(10):
#         Car.objects.create(
#             car_id='ABCDE' + str(i),
#             car_type='c2'
#         )
# except:
#     pass

